import request from '../utils/request'
import requestExcel from '../utils/request-excel'

export function getUsers(current, size, userVO) {
    return request({
        url: '/user/getUsers',
        method: 'post',
        params: {
            current,
            size,
        },
        data: userVO
    })
}

export function updateUserStatus(id, status) {
    return request({
        url: '/user/updateUserStatus',
        method: 'post',
        params: {
            id,
            status,
        }
    })
}

export function outUserlist(userVO) {
    return requestExcel({
        url: '/user/export',
        method: 'post',
        data: userVO,
        responseType: "blob"
    })
}

export function login(username, password) {
    return request({
        url: '/user/login',
        method: 'post',
        params: {
            username,
            password,
        }
    })
}

export const deleteImgFile = (file) => {
    return request({
        url: '/upload/deleteImgFile',
        method: 'post',
        params: {
            file
        }
    })
}